%% Mix a signal with a given sign pattern
% The function decide the polarity of the signal on t_axis, according to
% the given pattern and its period - Tp. Rounding (to floor) is used to determine the
% closest sign index in the pattern
function MixedSig = MixSignal(Sig,t_axis,Pattern,Tp)
M = length(Pattern);
Ind =   mod(  floor(t_axis/(Tp/M)) , M) + 1;
MixedSig = Sig .* Pattern(Ind);
